package com.bw.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
@Aspect
public class MyAop {
@Around("execution(* com.bw.Controller.*.*(..))")
    public  Object aop(ProceedingJoinPoint pjp) throws Throwable {
    Object proceed = pjp.proceed();
    Signature signature = pjp.getSignature();
    Date date = new Date();
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String format1 = format.format(date);

    return proceed;
}
}
